package com.cc.eb.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cc.eb.mapper.EbUserMapper;
import com.cc.eb.model.EbUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2022/1/8 10:41
 */
@Service
public class LoginService {
    @Resource
    private EbUserMapper ebUserMapper;

    /**
     * 根据用户名和密码完成登录
     * @param ebUser  登录用户对象
     * @return
     */
    public EbUser login(EbUser ebUser){
        EbUser lgnUser = ebUserMapper.selectOne(new QueryWrapper<EbUser>()
                .eq("eu_user_name", ebUser.getEuUserName())
                .eq("eu_password", ebUser.getEuPassword()));
        return lgnUser;
    }
}
